﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Domain.EquipmentManageDomain;
using Zocono.WCS.Infrastructure.ApllicationDto.DtoWcsManage;

namespace WcsTestProject
{
    public class PlanarEquipmentInit : ISettingInit
    {
        private IServiceProvider _provider;
        private ISnowflake snowflake;
        IDispatchEquipmentService service;

        public PlanarEquipmentInit(IServiceProvider provider)
        {
            _provider = provider;
            snowflake = _provider.GetService<ISnowflake>();
            service = provider.GetService<IDispatchEquipmentService>();
        }

        public async Task<bool> Init()
        {
            /// 1、MOA-D电气图纸打印20211109
            await InitMOAD();

            /// 2、Z21092-MOF线体电柜标注图（MOE,MOF)
            /// 3、Z21092-MOF线体电柜标注图（MOE,MOF)A
            await InitMOF();

            /// 4、Z21092-M0G、MOH、M0I
            await InitMOGHI();

            /// 5、Z21092-MOL
            await InitMOL();

            /// 6、Z21092-M0N线体电柜
            await InitMON();

            /// 7、Z21092-M0P线体电柜标注图
            await InitMOP();

            /// 8、z21092-MOS
            await InitMOS();

            /// 9、Z21092无为比亚迪M0J-MOR
            await InitMOJR();

            return true;
        }

        /// <summary>
        /// 1、MOA-D电气图纸打印20211109
        /// </summary>
        protected async Task<bool> InitMOAD()
        {
            #region Z211092-MOA-D

            //A1101-A1107
            await AddDispatchEquipmentAsync(service, snowflake, "A1", 101, 107, new int[] { });
            //A1201-A1207
            await AddDispatchEquipmentAsync(service, snowflake, "A1", 201, 208, new int[] { });

            //A2101-A2104
            await AddDispatchEquipmentAsync(service, snowflake, "A2", 101, 104, new int[] { });
            //A2201-A2204
            await AddDispatchEquipmentAsync(service, snowflake, "A2", 201, 204, new int[] { });
            //A2301-A2303
            await AddDispatchEquipmentAsync(service, snowflake, "A2", 301, 303, new int[] { });

            //A3101-A3103
            await AddDispatchEquipmentAsync(service, snowflake, "A3", 101, 103, new int[] { });
            //A3201-A3203
            await AddDispatchEquipmentAsync(service, snowflake, "A3", 201, 203, new int[] { });
            //A3301-A3303
            await AddDispatchEquipmentAsync(service, snowflake, "A3", 301, 303, new int[] { });

            //A4101-A4103
            await AddDispatchEquipmentAsync(service, snowflake, "A4", 101, 103, new int[] { });
            //A4201-A4203
            await AddDispatchEquipmentAsync(service, snowflake, "A4", 201, 203, new int[] { });
            //A4301-A4303
            await AddDispatchEquipmentAsync(service, snowflake, "A4", 301, 303, new int[] { });

            //A5101-A5106
            await AddDispatchEquipmentAsync(service, snowflake, "A5", 101, 106, new int[] { });
            //A5201-A5206
            await AddDispatchEquipmentAsync(service, snowflake, "A5", 201, 206, new int[] { });
            //A5301-A5306
            await AddDispatchEquipmentAsync(service, snowflake, "A5", 301, 303, new int[] { });

            //A5101-A5106
            await AddDispatchEquipmentAsync(service, snowflake, "A5", 101, 106, new int[] { });
            //A5201-A5206
            await AddDispatchEquipmentAsync(service, snowflake, "A5", 201, 206, new int[] { });
            //A5301-A5306
            await AddDispatchEquipmentAsync(service, snowflake, "A5", 301, 303, new int[] { });

            //B1101-B1103
            await AddDispatchEquipmentAsync(service, snowflake, "B1", 101, 103, new int[] { });
            //B1201-B1208
            await AddDispatchEquipmentAsync(service, snowflake, "B1", 201, 208, new int[] { });
            //B1301-B1317
            await AddDispatchEquipmentAsync(service, snowflake, "B1", 301, 317, new int[] { });

            //B2101-B2105
            await AddDispatchEquipmentAsync(service, snowflake, "B2", 101, 108, new int[] { });
            //B2201-B2210
            await AddDispatchEquipmentAsync(service, snowflake, "B2", 201, 210, new int[] { });
            //B2301-B2308
            await AddDispatchEquipmentAsync(service, snowflake, "B2", 301, 308, new int[] { });

            //B3101-B3103
            await AddDispatchEquipmentAsync(service, snowflake, "B3", 101, 103, new int[] { });
            //B3201
            await AddDispatchEquipmentAsync(service, snowflake, "B3", 201, 202, new int[] { 202 });
            //B3301-B3311
            await AddDispatchEquipmentAsync(service, snowflake, "B3", 301, 311, new int[] { });

            //B4101-B4121
            await AddDispatchEquipmentAsync(service, snowflake, "B4", 101, 121, new int[] { });
            //B4201-B4209
            await AddDispatchEquipmentAsync(service, snowflake, "B4", 201, 209, new int[] { });

            //D3301-D3304
            await AddDispatchEquipmentAsync(service, snowflake, "D3", 301, 304, new int[] { });
            //D9301-D9304
            await AddDispatchEquipmentAsync(service, snowflake, "D9", 301, 304, new int[] { });
            //DE301-DE304
            await AddDispatchEquipmentAsync(service, snowflake, "DE", 301, 304, new int[] { });
            //DF301
            await AddDispatchEquipmentAsync(service, snowflake, "DF", 301, 302, new int[] { 302 });

            //D1401-D1402
            await AddDispatchEquipmentAsync(service, snowflake, "D1", 401, 402, new int[] { });
            //D1301-D1302
            await AddDispatchEquipmentAsync(service, snowflake, "D1", 301, 302, new int[] { });
            //D1201-D1206
            await AddDispatchEquipmentAsync(service, snowflake, "D1", 201, 206, new int[] { });
            //D1101-D1102
            await AddDispatchEquipmentAsync(service, snowflake, "D1", 101, 102, new int[] { });
            //D2401
            await AddDispatchEquipmentAsync(service, snowflake, "D2", 401, 402, new int[] { 402 });
            //D2301-D2302
            await AddDispatchEquipmentAsync(service, snowflake, "D2", 301, 302, new int[] { });
            //D2201-D2204
            await AddDispatchEquipmentAsync(service, snowflake, "D2", 201, 204, new int[] { });
            //D2101-D2105
            await AddDispatchEquipmentAsync(service, snowflake, "D2", 101, 105, new int[] { });

            //D5401-D5403
            await AddDispatchEquipmentAsync(service, snowflake, "D5", 401, 403, new int[] { });
            //D5301-D5303
            await AddDispatchEquipmentAsync(service, snowflake, "D5", 301, 303, new int[] { });
            //D5201-D5204
            await AddDispatchEquipmentAsync(service, snowflake, "D5", 201, 204, new int[] { });
            //D5101-D5104
            await AddDispatchEquipmentAsync(service, snowflake, "D5", 101, 104, new int[] { });
            //D4201-D4204
            await AddDispatchEquipmentAsync(service, snowflake, "D4", 201, 204, new int[] { });
            //D4101-D4105
            await AddDispatchEquipmentAsync(service, snowflake, "D4", 101, 105, new int[] { });
            //D3201-D3207
            await AddDispatchEquipmentAsync(service, snowflake, "D3", 201, 207, new int[] { });
            //D3101-D3105
            await AddDispatchEquipmentAsync(service, snowflake, "D3", 101, 105, new int[] { });

            //D6301-D6305
            await AddDispatchEquipmentAsync(service, snowflake, "D6", 301, 305, new int[] { });
            //D6201-D6205
            await AddDispatchEquipmentAsync(service, snowflake, "D6", 201, 205, new int[] { });
            //D6101-D6109
            await AddDispatchEquipmentAsync(service, snowflake, "D6", 101, 109, new int[] { });

            //D8401
            await AddDispatchEquipmentAsync(service, snowflake, "D8", 401, 402, new int[] { 402 });
            //D8301
            await AddDispatchEquipmentAsync(service, snowflake, "D8", 301, 302, new int[] { 302 });
            //D8201-D8204
            await AddDispatchEquipmentAsync(service, snowflake, "D8", 201, 204, new int[] { });
            //D8101-D8104
            await AddDispatchEquipmentAsync(service, snowflake, "D8", 101, 104, new int[] { });
            //D7401-D7403
            await AddDispatchEquipmentAsync(service, snowflake, "D7", 401, 403, new int[] { });
            //D7301-D7303
            await AddDispatchEquipmentAsync(service, snowflake, "D7", 301, 303, new int[] { });
            //D7201-D7208
            await AddDispatchEquipmentAsync(service, snowflake, "D7", 201, 208, new int[] { });
            //D7101-D7105
            await AddDispatchEquipmentAsync(service, snowflake, "D7", 101, 105, new int[] { });

            //DA401-DA402
            await AddDispatchEquipmentAsync(service, snowflake, "DA", 401, 402, new int[] { });
            //DA301-DA302
            await AddDispatchEquipmentAsync(service, snowflake, "DA", 301, 302, new int[] { });
            //DA201-DA207
            await AddDispatchEquipmentAsync(service, snowflake, "DA", 201, 207, new int[] { });
            //DA101-DA108
            await AddDispatchEquipmentAsync(service, snowflake, "DA", 101, 108, new int[] { });
            //D9201-D9207
            await AddDispatchEquipmentAsync(service, snowflake, "D9", 201, 207, new int[] { });
            //D9101-D9105
            await AddDispatchEquipmentAsync(service, snowflake, "D9", 101, 105, new int[] { });

            //DB401-DB403
            await AddDispatchEquipmentAsync(service, snowflake, "DB", 401, 403, new int[] { });
            //DB301-DB304
            await AddDispatchEquipmentAsync(service, snowflake, "DB", 301, 304, new int[] { });
            //DB201-DB209
            await AddDispatchEquipmentAsync(service, snowflake, "DB", 201, 209, new int[] { });
            //DB101-DB103
            await AddDispatchEquipmentAsync(service, snowflake, "DB", 101, 103, new int[] { });
            //DD201-DD204
            await AddDispatchEquipmentAsync(service, snowflake, "DD", 201, 204, new int[] { });
            //DD101-DD104
            await AddDispatchEquipmentAsync(service, snowflake, "DD", 101, 104, new int[] { });

            //DC401
            await AddDispatchEquipmentAsync(service, snowflake, "DC", 401, 402, new int[] { 402 });
            //DC301-DC304
            await AddDispatchEquipmentAsync(service, snowflake, "DC", 301, 304, new int[] { });
            //DC201-DC208
            await AddDispatchEquipmentAsync(service, snowflake, "DC", 201, 208, new int[] { });
            //DC101-DC105
            await AddDispatchEquipmentAsync(service, snowflake, "DC", 101, 105, new int[] { });

            //DZ301-DZ305
            await AddDispatchEquipmentAsync(service, snowflake, "DZ", 301, 305, new int[] { });
            //DZ201-DZ209
            await AddDispatchEquipmentAsync(service, snowflake, "DZ", 201, 209, new int[] { });
            //DZ101-DZ103
            await AddDispatchEquipmentAsync(service, snowflake, "DZ", 101, 103, new int[] { });
            //DE201-DE205
            await AddDispatchEquipmentAsync(service, snowflake, "DE", 201, 205, new int[] { });
            //DE101-DE105
            await AddDispatchEquipmentAsync(service, snowflake, "DE", 101, 105, new int[] { });
            //DF201-DF207
            await AddDispatchEquipmentAsync(service, snowflake, "DF", 201, 207, new int[] { });
            //DF101-DF104
            await AddDispatchEquipmentAsync(service, snowflake, "DF", 101, 104, new int[] { });

            #endregion

            return true;
        }

        /// <summary>
        /// 2、Z21092-MOF线体电柜标注图（MOE,MOF)
        /// 3、Z21092-MOF线体电柜标注图（MOE,MOF)A
        /// </summary>
        protected async Task<bool> InitMOF()
        {
            #region Z21092-MOE,MOF

            //F1401-F1405
            await AddDispatchEquipmentAsync(service, snowflake, "F1", 401, 405, new int[] { });
            //F1301-F1304
            await AddDispatchEquipmentAsync(service, snowflake, "F1", 301, 304, new int[] { });
            //F1201-F1202
            await AddDispatchEquipmentAsync(service, snowflake, "F1", 201, 202, new int[] { });
            //F1101-F1103
            await AddDispatchEquipmentAsync(service, snowflake, "F1", 101, 103, new int[] { });

            //F2301-F2305
            await AddDispatchEquipmentAsync(service, snowflake, "F2", 301, 305, new int[] { });
            //F2201-F2211
            await AddDispatchEquipmentAsync(service, snowflake, "F2", 201, 211, new int[] { });
            //F2101-F2112
            await AddDispatchEquipmentAsync(service, snowflake, "F2", 101, 112, new int[] { });

            //F3301-F3303
            await AddDispatchEquipmentAsync(service, snowflake, "F3", 301, 303, new int[] { });
            //F3201-F3208
            await AddDispatchEquipmentAsync(service, snowflake, "F3", 201, 208, new int[] { });
            //F3101-F3108
            await AddDispatchEquipmentAsync(service, snowflake, "F3", 101, 108, new int[] { });

            //F4501-F4506
            await AddDispatchEquipmentAsync(service, snowflake, "F4", 501, 506, new int[] { });
            //F4401-F4405
            await AddDispatchEquipmentAsync(service, snowflake, "F4", 401, 405, new int[] { });
            //F4301
            await AddDispatchEquipmentAsync(service, snowflake, "F4", 301, 302, new int[] { 302 });
            //F4201-F4203
            await AddDispatchEquipmentAsync(service, snowflake, "F4", 201, 203, new int[] { });
            //F4101-F4102
            await AddDispatchEquipmentAsync(service, snowflake, "F4", 101, 102, new int[] { });

            //F5301-F5307
            await AddDispatchEquipmentAsync(service, snowflake, "F5", 301, 307, new int[] { });
            //F5201-F5206
            await AddDispatchEquipmentAsync(service, snowflake, "F5", 201, 206, new int[] { });
            //F5101-F5107
            await AddDispatchEquipmentAsync(service, snowflake, "F5", 101, 107, new int[] { });

            //F6501-F6507
            await AddDispatchEquipmentAsync(service, snowflake, "F6", 501, 507, new int[] { });
            //F6401-F6405
            await AddDispatchEquipmentAsync(service, snowflake, "F6", 401, 405, new int[] { });
            //F6301-F6302
            await AddDispatchEquipmentAsync(service, snowflake, "F6", 301, 302, new int[] { });
            //F6201-F6203
            await AddDispatchEquipmentAsync(service, snowflake, "F6", 201, 203, new int[] { });
            //F6101-F6102
            await AddDispatchEquipmentAsync(service, snowflake, "F6", 101, 102, new int[] { });

            //F7301-F7305
            await AddDispatchEquipmentAsync(service, snowflake, "F7", 301, 305, new int[] { });
            //F7201-F7206
            await AddDispatchEquipmentAsync(service, snowflake, "F7", 201, 206, new int[] { });
            //F7101-F7112
            await AddDispatchEquipmentAsync(service, snowflake, "F7", 101, 112, new int[] { });

            //F9101-F9103
            await AddDispatchEquipmentAsync(service, snowflake, "F9", 101, 103, new int[] { });
            //F9201-F9207
            await AddDispatchEquipmentAsync(service, snowflake, "F9", 201, 207, new int[] { });
            //F9301-F9307
            await AddDispatchEquipmentAsync(service, snowflake, "F9", 301, 307, new int[] { });

            //F8201-F8220
            await AddDispatchEquipmentAsync(service, snowflake, "F8", 201, 220, new int[] { });
            //F8101-F8104
            await AddDispatchEquipmentAsync(service, snowflake, "F8", 101, 104, new int[] { });

            //FB101-FB103
            await AddDispatchEquipmentAsync(service, snowflake, "FB", 101, 103, new int[] { });
            //FB201-FB207
            await AddDispatchEquipmentAsync(service, snowflake, "FB", 201, 207, new int[] { });
            //FB301-FB307
            await AddDispatchEquipmentAsync(service, snowflake, "FB", 301, 307, new int[] { });

            //FA201-FA220
            await AddDispatchEquipmentAsync(service, snowflake, "FA", 201, 220, new int[] { });
            //FA101-FA104
            await AddDispatchEquipmentAsync(service, snowflake, "FA", 101, 104, new int[] { });

            //FD101-FD117
            await AddDispatchEquipmentAsync(service, snowflake, "FD", 101, 117, new int[] { });

            //FC201-FC211
            await AddDispatchEquipmentAsync(service, snowflake, "FC", 201, 211, new int[] { });
            //FC101-FC111
            await AddDispatchEquipmentAsync(service, snowflake, "FC", 101, 111, new int[] { });

            #endregion

            return true;
        }

        /// <summary>
        /// 4、Z21092-M0G、MOH、M0I
        /// </summary>
        protected async Task<bool> InitMOGHI()
        {
            #region InitMOGHI

            //G1301-G1311
            await AddDispatchEquipmentAsync(service, snowflake, "G1", 301, 311, new int[] { });
            //G1201-G1213
            await AddDispatchEquipmentAsync(service, snowflake, "G1", 201, 213, new int[] { });
            //G2101-G2116
            await AddDispatchEquipmentAsync(service, snowflake, "G2", 101, 116, new int[] { });
            //G3301-G3311
            await AddDispatchEquipmentAsync(service, snowflake, "G3", 301, 311, new int[] { });
            //G3201-G3216
            await AddDispatchEquipmentAsync(service, snowflake, "G3", 201, 216, new int[] { });
            //G4101-G4115
            await AddDispatchEquipmentAsync(service, snowflake, "G4", 101, 115, new int[] { });
            //G5301-G5311
            await AddDispatchEquipmentAsync(service, snowflake, "G5", 301, 311, new int[] { });
            //G5201-G5216
            await AddDispatchEquipmentAsync(service, snowflake, "G5", 201, 216, new int[] { });
            //G6101-G6115
            await AddDispatchEquipmentAsync(service, snowflake, "G6", 101, 115, new int[] { });

            //I1201-I1214
            await AddDispatchEquipmentAsync(service, snowflake, "I1", 201, 214, new int[] { });
            //I1101-I1106
            await AddDispatchEquipmentAsync(service, snowflake, "I1", 101, 106, new int[] { });
            //I2201-I2205
            await AddDispatchEquipmentAsync(service, snowflake, "I2", 201, 205, new int[] { });
            //I2101-I2108
            await AddDispatchEquipmentAsync(service, snowflake, "I2", 101, 108, new int[] { });
            //I3201-I3212
            await AddDispatchEquipmentAsync(service, snowflake, "I3", 201, 212, new int[] { });
            //I3101-I3107
            await AddDispatchEquipmentAsync(service, snowflake, "I3", 101, 107, new int[] { });
            //I4201-I4215
            await AddDispatchEquipmentAsync(service, snowflake, "I4", 201, 215, new int[] { });
            //I4101-I4106
            await AddDispatchEquipmentAsync(service, snowflake, "I4", 101, 106, new int[] { });

            #endregion

            return true;
        }

        /// <summary>
        /// 5、Z21092-MOL
        /// </summary>
        protected async Task<bool> InitMOL()
        {
            #region Z21092-MOL

            //L1401-L1420
            await AddDispatchEquipmentAsync(service, snowflake, "L1", 401, 420, new int[] { });
            //L1301
            await AddDispatchEquipmentAsync(service, snowflake, "L1", 301, 302, new int[] { 302 });
            //L1201
            await AddDispatchEquipmentAsync(service, snowflake, "L1", 201, 202, new int[] { 202 });
            //L1101-L1109
            await AddDispatchEquipmentAsync(service, snowflake, "L1", 101, 109, new int[] { });
            //L2401-L2410
            await AddDispatchEquipmentAsync(service, snowflake, "L2", 401, 410, new int[] { });
            //L2301-L2308
            await AddDispatchEquipmentAsync(service, snowflake, "L2", 301, 308, new int[] { });
            //L2201-L2206
            await AddDispatchEquipmentAsync(service, snowflake, "L2", 201, 206, new int[] { });
            //L3101-L3127
            await AddDispatchEquipmentAsync(service, snowflake, "L3", 101, 127, new int[] { });
            //L3201-L3209
            await AddDispatchEquipmentAsync(service, snowflake, "L3", 201, 209, new int[] { });
            //L4101-L4128
            await AddDispatchEquipmentAsync(service, snowflake, "L4", 101, 128, new int[] { });

            #endregion

            return true;
        }

        /// <summary>
        /// 6、Z21092-M0N线体电柜
        /// </summary>
        protected async Task<bool> InitMON()
        {
            #region Z21092-MON

            //N1201-N1209
            await AddDispatchEquipmentAsync(service, snowflake, "N1", 201, 209, new int[] { });

            //N1101-N1113
            await AddDispatchEquipmentAsync(service, snowflake, "N1", 101, 113, new int[] { });

            //N2201-N2221
            await AddDispatchEquipmentAsync(service, snowflake, "N2", 201, 221, new int[] { });

            //N2101-N2109
            await AddDispatchEquipmentAsync(service, snowflake, "N2", 101, 109, new int[] { });

            //N3101-N3109
            await AddDispatchEquipmentAsync(service, snowflake, "N3", 101, 109, new int[] { });

            //N3201-N3221
            await AddDispatchEquipmentAsync(service, snowflake, "N3", 201, 221, new int[] { });

            #endregion

            return true;
        }

        /// <summary>
        /// 7、Z21092-M0P线体电柜标注图
        /// </summary>
        protected async Task<bool> InitMOP()
        {
            #region Z21092-M0P

            //P5401
            await AddDispatchEquipmentAsync(service, snowflake, "P5", 401, 402, new int[] { 402 });
            //P5301
            await AddDispatchEquipmentAsync(service, snowflake, "P5", 301, 302, new int[] { 302 });
            //P5201
            await AddDispatchEquipmentAsync(service, snowflake, "P5", 201, 202, new int[] { 202 });
            //P5101-P5106
            await AddDispatchEquipmentAsync(service, snowflake, "P5", 101, 106, new int[] { });
            //P6401-P6404
            await AddDispatchEquipmentAsync(service, snowflake, "P6", 401, 404, new int[] { });
            //P6301-P6304
            await AddDispatchEquipmentAsync(service, snowflake, "P6", 301, 304, new int[] { });
            //P6201-P6204
            await AddDispatchEquipmentAsync(service, snowflake, "P6", 201, 204, new int[] { });
            //P6101-P6102
            await AddDispatchEquipmentAsync(service, snowflake, "P6", 101, 102, new int[] { });
            //P7501-P7505
            await AddDispatchEquipmentAsync(service, snowflake, "P7", 501, 505, new int[] { });
            //P7401-P7405
            await AddDispatchEquipmentAsync(service, snowflake, "P7", 401, 405, new int[] { });
            //P7301-P7305
            await AddDispatchEquipmentAsync(service, snowflake, "P7", 301, 305, new int[] { });
            //P7201-P7205
            await AddDispatchEquipmentAsync(service, snowflake, "P7", 201, 205, new int[] { });
            //P7101-P7106
            await AddDispatchEquipmentAsync(service, snowflake, "P7", 101, 106, new int[] { });
            //P8401-P8404
            await AddDispatchEquipmentAsync(service, snowflake, "P8", 401, 404, new int[] { });
            //P8301-P8310
            await AddDispatchEquipmentAsync(service, snowflake, "P8", 301, 310, new int[] { });
            //P8201-P8213
            await AddDispatchEquipmentAsync(service, snowflake, "P8", 201, 213, new int[] { });
            //P8101-P8102
            await AddDispatchEquipmentAsync(service, snowflake, "P8", 101, 102, new int[] { });
            //P9501-P9502
            await AddDispatchEquipmentAsync(service, snowflake, "P9", 501, 502, new int[] { });
            //P9401-P9408
            await AddDispatchEquipmentAsync(service, snowflake, "P9", 401, 408, new int[] { });
            //P9301-P9303
            await AddDispatchEquipmentAsync(service, snowflake, "P9", 301, 303, new int[] { });
            //P9201-P9206
            await AddDispatchEquipmentAsync(service, snowflake, "P9", 201, 206, new int[] { });
            //P9101-P9105
            await AddDispatchEquipmentAsync(service, snowflake, "P9", 101, 105, new int[] { });
            //PA101-PA107
            await AddDispatchEquipmentAsync(service, snowflake, "PA", 101, 107, new int[] { });
            //PA201-PA207
            await AddDispatchEquipmentAsync(service, snowflake, "PA", 201, 207, new int[] { });

            //P2301-P2310
            await AddDispatchEquipmentAsync(service, snowflake, "P2", 301, 310, new int[] { });
            //P2201-P2212
            await AddDispatchEquipmentAsync(service, snowflake, "P2", 201, 212, new int[] { });
            //P2101-P2110
            await AddDispatchEquipmentAsync(service, snowflake, "P2", 101, 110, new int[] { });
            //P3301-P3308
            await AddDispatchEquipmentAsync(service, snowflake, "P3", 301, 308, new int[] { });
            //P3201-P3210
            await AddDispatchEquipmentAsync(service, snowflake, "P3", 201, 210, new int[] { });
            //P3101-P3105
            await AddDispatchEquipmentAsync(service, snowflake, "P3", 101, 105, new int[] { });
            //P4301-P4305
            await AddDispatchEquipmentAsync(service, snowflake, "P4", 301, 305, new int[] { });
            //P4201-P4210
            await AddDispatchEquipmentAsync(service, snowflake, "P4", 201, 210, new int[] { });
            //P4101-P4108
            await AddDispatchEquipmentAsync(service, snowflake, "P4", 101, 108, new int[] { });


            //P1101-P1124
            await AddDispatchEquipmentAsync(service, snowflake, "P1", 101, 124, new int[] { });


            #endregion

            return true;
        }

        /// <summary>
        /// 8、z21092-MOS
        /// </summary>
        protected async Task<bool> InitMOS()
        {
            #region Z21092-MOS

            //S1101-S1107
            await AddDispatchEquipmentAsync(service, snowflake, "S1", 101, 107, new int[] { });
            //S1201-S1204
            await AddDispatchEquipmentAsync(service, snowflake, "S1", 201, 204, new int[] { });
            //S1301-S1302
            await AddDispatchEquipmentAsync(service, snowflake, "S1", 301, 302, new int[] { });

            //S2101-S2111
            await AddDispatchEquipmentAsync(service, snowflake, "S2", 101, 111, new int[] { });
            //S2201-S2204
            await AddDispatchEquipmentAsync(service, snowflake, "S2", 201, 204, new int[] { });
            //S2301-S2304
            await AddDispatchEquipmentAsync(service, snowflake, "S2", 301, 304, new int[] { });

            //S3101-S3108
            await AddDispatchEquipmentAsync(service, snowflake, "S3", 101, 108, new int[] { });
            //S3201-S3206
            await AddDispatchEquipmentAsync(service, snowflake, "S3", 201, 206, new int[] { });
            //S3301-S3306
            await AddDispatchEquipmentAsync(service, snowflake, "S3", 301, 306, new int[] { });

            //S4101-S4106
            await AddDispatchEquipmentAsync(service, snowflake, "S4", 101, 106, new int[] { });
            //S4201-S4207
            await AddDispatchEquipmentAsync(service, snowflake, "S4", 201, 207, new int[] { });
            //S4301-S4306
            await AddDispatchEquipmentAsync(service, snowflake, "S4", 301, 306, new int[] { });

            //S5101-S5106
            await AddDispatchEquipmentAsync(service, snowflake, "S5", 101, 106, new int[] { });
            //S5201-S5207
            await AddDispatchEquipmentAsync(service, snowflake, "S5", 201, 207, new int[] { });
            //S5301-S5306
            await AddDispatchEquipmentAsync(service, snowflake, "S5", 301, 306, new int[] { });

            //S6101-S6108
            await AddDispatchEquipmentAsync(service, snowflake, "S6", 101, 108, new int[] { });
            //S6201-S6208
            await AddDispatchEquipmentAsync(service, snowflake, "S6", 201, 208, new int[] { });

            #endregion

            return true;
        }

        /// <summary>
        /// 9、Z21092无为比亚迪M0J-MOR
        /// </summary>
        protected async Task<bool> InitMOJR()
        {
            #region Z21092M0J-MOR

            //J1101-J1109
            await AddDispatchEquipmentAsync(service, snowflake, "J1", 101, 109, new int[] { });
            //J1201
            await AddDispatchEquipmentAsync(service, snowflake, "J1", 201, 202, new int[] { 202 });
            //J1301-J1305
            await AddDispatchEquipmentAsync(service, snowflake, "J1", 301, 305, new int[] { });

            //J2101-J2106
            await AddDispatchEquipmentAsync(service, snowflake, "J2", 101, 106, new int[] { });
            //J2201-J2207
            await AddDispatchEquipmentAsync(service, snowflake, "J2", 201, 207, new int[] { });
            //J2301-J2308
            await AddDispatchEquipmentAsync(service, snowflake, "J2", 301, 308, new int[] { });

            //J3101-J3106
            await AddDispatchEquipmentAsync(service, snowflake, "J3", 101, 106, new int[] { });
            //J3201-J3213
            await AddDispatchEquipmentAsync(service, snowflake, "J3", 201, 213, new int[] { });
            //J3301-J3313
            await AddDispatchEquipmentAsync(service, snowflake, "J3", 301, 313, new int[] { });

            //J4101-J4108
            await AddDispatchEquipmentAsync(service, snowflake, "J4", 101, 108, new int[] { });
            //J4201-J4207
            await AddDispatchEquipmentAsync(service, snowflake, "J4", 201, 207, new int[] { });
            //J4301-J4307
            await AddDispatchEquipmentAsync(service, snowflake, "J4", 301, 307, new int[] { });
            //J5101-J5107
            await AddDispatchEquipmentAsync(service, snowflake, "J5", 101, 107, new int[] { });
            //J5201-J5209
            await AddDispatchEquipmentAsync(service, snowflake, "J5", 201, 209, new int[] { });
            //J5301-J5311
            await AddDispatchEquipmentAsync(service, snowflake, "J5", 301, 311, new int[] { });
            //J6101-J6106
            await AddDispatchEquipmentAsync(service, snowflake, "J6", 101, 106, new int[] { });
            //J6201-J6206
            await AddDispatchEquipmentAsync(service, snowflake, "J6", 201, 206, new int[] { });
            //J6301-J6307
            await AddDispatchEquipmentAsync(service, snowflake, "J6", 301, 307, new int[] { });

            //R1101-R1107
            await AddDispatchEquipmentAsync(service, snowflake, "R1", 101, 107, new int[] { });
            //R1201-R1203
            await AddDispatchEquipmentAsync(service, snowflake, "R1", 201, 203, new int[] { });
            //R1301-R1303
            await AddDispatchEquipmentAsync(service, snowflake, "R1", 301, 303, new int[] { });

            //R2101-R2102
            await AddDispatchEquipmentAsync(service, snowflake, "R2", 101, 102, new int[] { });
            //R2201-R2205
            await AddDispatchEquipmentAsync(service, snowflake, "R2", 201, 205, new int[] { });
            //R2301-R2305
            await AddDispatchEquipmentAsync(service, snowflake, "R2", 301, 305, new int[] { });
            //R2401-R2405
            await AddDispatchEquipmentAsync(service, snowflake, "R2", 401, 405, new int[] { });

            //R3101-R3107
            await AddDispatchEquipmentAsync(service, snowflake, "R3", 101, 107, new int[] { });
            //R3201-R3207
            await AddDispatchEquipmentAsync(service, snowflake, "R3", 201, 207, new int[] { });
            //R3301-R3307
            await AddDispatchEquipmentAsync(service, snowflake, "R3", 301, 307, new int[] { });
            //R3401-R3407
            await AddDispatchEquipmentAsync(service, snowflake, "R3", 401, 407, new int[] { });

            //R4101-R4105
            await AddDispatchEquipmentAsync(service, snowflake, "R4", 101, 105, new int[] { });
            //R4201-R4205
            await AddDispatchEquipmentAsync(service, snowflake, "R4", 201, 205, new int[] { });
            //R4301-R4305
            await AddDispatchEquipmentAsync(service, snowflake, "R4", 301, 305, new int[] { });
            //R4401-R4403
            await AddDispatchEquipmentAsync(service, snowflake, "R4", 401, 403, new int[] { });

            //R5101-R5107
            await AddDispatchEquipmentAsync(service, snowflake, "R5", 101, 107, new int[] { });
            //R5201-R5207
            await AddDispatchEquipmentAsync(service, snowflake, "R5", 201, 207, new int[] { });
            //R5301-R5307
            await AddDispatchEquipmentAsync(service, snowflake, "R5", 301, 307, new int[] { });

            //R6101-R6107
            await AddDispatchEquipmentAsync(service, snowflake, "R6", 101, 107, new int[] { });
            //R6201-R6207
            await AddDispatchEquipmentAsync(service, snowflake, "R6", 201, 207, new int[] { });
            //R6301-R6303
            await AddDispatchEquipmentAsync(service, snowflake, "R6", 301, 303, new int[] { });

            //R7101-R7109
            await AddDispatchEquipmentAsync(service, snowflake, "R7", 101, 109, new int[] { });
            //R7201-R7206
            await AddDispatchEquipmentAsync(service, snowflake, "R7", 201, 206, new int[] { });
            //R7301-R7302
            await AddDispatchEquipmentAsync(service, snowflake, "R7", 301, 302, new int[] { });

            #endregion

            return true;
        }

        private async Task AddDispatchEquipmentAsync(IDispatchEquipmentService service, ISnowflake snowflake, string areaCode, int fromNum, int toNum, int[] excludeArr)
        {
            for (int i = fromNum; i <= toNum; i++)
            {
                if (excludeArr.Contains(i))
                {
                    continue;
                }

                await service.AddDispatchEquipmentAsync(new DispatchEquipmentInfoDto()
                {
                    //ID = snowflake.GetId(),
                    AreaCode = areaCode,
                    EquipmentCode = $"{areaCode}{i}",
                    EquipmentName = $"{areaCode}{i}",
                    EquipmentTypeID = 1468762773113671680,
                    StationCount = 1,
                    EquipmentTypeName = "平面设备"
                });
            }
        }
    }
}
